<template>
    <div class="programModify">
        <el-form 
            ref="ruleForm" 
            label-width="100px"
            :model="ruleForm">
            <el-form-item label="渠道名称" prop="channel_name">
                <el-input v-model="ruleForm.channel_name" :placeholder=channel_name></el-input>
            </el-form-item>
            <el-form-item label="渠道跳转页" prop="channel_url">
                <el-select v-model="ruleForm.channel_url" :placeholder=channel_url>
                    <el-option label='index' value='index'>index</el-option>
                    <el-option label='start' value='start'>start</el-option>
                </el-select>
            </el-form-item>
        </el-form>
       <el-button @click="submitForm('ruleForm')" size="medium" class="addSubimit">修改</el-button>
    </div>
</template>
<script>
import { AddData } from '@/assets/js'
export default {
    data(){
        return {
            ruleForm:{
                channel_name:'', //渠道
                channel_url:''//渠道跳转页
            }
        }
    },
    mounted:function(){
    },
    methods:{
        submitForm:function(e){
            let data = {
                cid:this.CID,
                channel_name:this.ruleForm.channel_name==''?this.channel_name:this.ruleForm.channel_name,
                channel_url:this.ruleForm.channel_url==''?this.channel_url:this.ruleForm.channel_url,
            }
            AddData(this,e,data,'channel/editChannel')
        }
    },
    props:['CID',"channel_name","channel_url"]
}
</script>